/******************************************************************************
 * Copyright (C) 2016 Wuhan Water Elephant Co.Ltd All Rights Reserved. 
 * 本软件为武汉水象科技有限公司开发研制。 未经本公司正式书面同意，其他任何个人、
 * 团体不得使用、复制、修改或发布本软件.
 *****************************************************************************/
package com.loanapp.server.market.api.customer.api;


import com.github.pagehelper.PageInfo;
import com.loanapp.server.market.api.customer.entity.CustomerBorrowInfo;
import com.loanapp.server.market.api.customer.hystrix.CustomerBorrowInfoApiFallbackFactory;
import com.loanapp.server.market.api.customer.query.CustomerBorrowInfoQuery;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;


@FeignClient(value = "loanapp-server-market-provider",path = CustomerBorrowInfoApi.mapping,fallbackFactory = CustomerBorrowInfoApiFallbackFactory.class)
public interface CustomerBorrowInfoApi {

     static String mapping="customerBorrowInfo";

     @PostMapping("InsertCustomerBorrowInfo")
     Long InsertCustomerBorrowInfo(@RequestBody CustomerBorrowInfo customerBorrowInfo) throws Exception;

     @PostMapping("selectOne")
     CustomerBorrowInfo selectOne(@RequestParam("Biid") Long Biid) throws  Exception;

     /**
      * 获取帖子列表（带评论条数）
      * @return
      */
     @PostMapping("getBorrowInfoListPage")
     public PageInfo<Map<String,Object>> getBorrowInfoListPage(@RequestBody CustomerBorrowInfoQuery query) throws Exception;

     /***
      * 查询用户申请记录
      * @param page
      * @param user
      * @return
      */
     @PostMapping("getApplyListPage")
     List<Map<String, Object>> getApplyListPage(@RequestBody int[] page,@RequestParam("user") Long user);

     /***
      * 添加用户申请记录
      * @param user
      * @param productId
      */
     @PostMapping("insertApplyRecord")
     void insertApplyRecord(@RequestParam("user") Long user,@RequestParam("productId") Long productId);
}
